Purely Functional Worst Case Constant Time Catenable Sorted Lists
نویسندگان
چکیده
We present a purely functional implementation of search trees that requires O(log n) time for search and update operations and supports the join of two trees in worst case constant time. Hence, we solve an open problem posed by Kaplan and Tarjan as to whether it is possible to envisage a data structure supporting simultaneously the join operation in O(1) time and the search and update operations in O(log n) time.
منابع مشابه
Amortization, Lazy Evaluation, and Persistence: Lists with Catenation via Lazy Linking
Amortization has been underutilized in the design of persistent data structures, largely because traditional accounting schemes break down in a persistent setting. Such schemes depend on saving “credits” for future use, but a persistent data structure may have multiple “futures”, each competing for the same credits. We describe how lazy evaluation can often remedy this problem, yielding persist...
متن کاملSimple and Efficient Purely Functional Queues and Deques
We present purely functional implementations of queues and double-ended queues (deques) requiring only O(1) time per operation in the worst case. Our algorithms are considerably simpler than previous designs with the same bounds. The inspiration for our approach is the incremental behavior of certain functions on lazy lists.
متن کاملNumerical Representations as Purely Functional Data Structures: a New Approach
This paper is concerned with design, implementation and verification of persistent purely functional data structures which are motivated by the representation of natural numbers using positional number systems. A new implementation of random-access list based on redundant segmented binary numbers is described. It uses 4 digits and an invariant which guarantees constant worst-case bounds for con...
متن کاملOn the Optimality of Tape Merge of Two Lists with Similar Size
The problem of merging sorted lists in the least number of pairwise comparisons has been solved completely only for a few special cases. Graham and Karp [18] independently discovered that the tape merge algorithm is optimal in the worst case when the two lists have the same size. In the seminal papers, Stockmeyer and Yao [28], Murphy and Paull [25], and Christen [6] independently showed when th...
متن کاملWorst-Case Execution Times for a Purely Functional Language
This paper provides guaranteed bounds on worst-case execution times for a strict, purely functional programming notation. Our approach involves combining time information obtained using a low-level commercial analyser with a high-level source-derived model to give worstcase execution time information. We validate our results using concrete timing information obtained using machine code fragment...
متن کامل